package com.shrcl.engineerprocess.domain.impl;

import com.shrcl.engineerprocess.domain.Certification;
import com.shrcl.engineerprocess.domain.Engineer;
import com.shrcl.engineerprocess.domain.EngineerCertification;
import com.shrcl.engineerprocess.domain.EngineerCertificationDAO;
import edu.fudan.mylang.pf.BaseDAOService;
import org.eclipse.xtext.xbase.lib.Procedures.Procedure1;
import org.springframework.stereotype.Service;

@Service("com.shrcl.engineerprocess.domain.EngineerCertificationDAO")
public class EngineerCertificationDAOImpl extends BaseDAOService<EngineerCertification> implements EngineerCertificationDAO {
  public EngineerCertification renewEngineerCert(final EngineerCertification engineerCertification) {
    Engineer _engineer = engineerCertification.getEngineer();
    final Procedure1<EngineerCertification> _function = new Procedure1<EngineerCertification>() {
        public void apply(final EngineerCertification it) {
          Certification _certification = engineerCertification.getCertification();
          it.setCertification(_certification);
          it.setDerivedCerf(engineerCertification);
        }
      };
    EngineerCertification _addCertification = _engineer.addCertification(_function);
    return _addCertification;
  }
}
